home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / fpu881 / src6.zoo / csin.c < prev    next >
C/C++ Source or Header  |  1991-09-24  |  2KB  |  84 lines

  1. /************************************************************************
  2.  *                                    *
  3.  *                N O T I C E                *
  4.  *                                    *
  5.  *            Copyright Abandoned, 1987, Fred Fish        *
  6.  *                                    *
  7.  *    This previously copyrighted work has been placed into the    *
  8.  *    public domain by the author (Fred Fish) and may be freely used    *
  9.  *    for any purpose, private or commercial.  I would appreciate    *
  10.  *    it, as a courtesy, if this notice is left in all copies and    *
  11.  *    derivative works.  Thank you, and enjoy...            *
  12.  *                                    *
  13.  *    The author makes no warranty of any kind with respect to this    *
  14.  *    product and explicitly disclaims any implied warranties of    *
  15.  *    merchantability or fitness for any particular purpose.        *
  16.  *                                    *
  17.  ************************************************************************
  18.  */
  19.  
  20.  
  21. /*
  22.  *  FUNCTION
  23.  *
  24.  *    csin   complex double precision sine
  25.  *
  26.  *  KEY WORDS
  27.  *
  28.  *    csin
  29.  *    complex functions
  30.  *    machine independent routines
  31.  *    math libraries
  32.  *
  33.  *  DESCRIPTION
  34.  *
  35.  *    Computes double precision complex sine of a double
  36.  *    precision complex argument.
  37.  *
  38.  *  USAGE
  39.  *
  40.  *    COMPLEX csin (z)
  41.  *    COMPLEX z;
  42.  *
  43.  *  REFERENCES
  44.  *
  45.  *    Fortran 77 user's guide, Digital Equipment Corp. pp B-12
  46.  *
  47.  *  PROGRAMMER
  48.  *
  49.  *    Fred Fish
  50.  *    Tempe, Az 85281
  51.  *    (602) 966-8871
  52.  *
  53.  *  INTERNALS
  54.  *
  55.  *    Computes complex sine of z = x + j y from:
  56.  *
  57.  *        1.    r_csin = sin(x) * cosh(y)
  58.  *
  59.  *        2.    i_csin = cos(x) * sinh(y)
  60.  *
  61.  *        3.    csin(z) = r_csin + j i_csin
  62.  *
  63.  */
  64.  
  65. #include <stdio.h>
  66. #include <pmluser.h>
  67. #include "pml.h"
  68.  
  69.  
  70. COMPLEX csin (z)
  71. COMPLEX z;
  72. {
  73.     COMPLEX result;
  74.     extern double sin(), cos(), sinh(), cosh();
  75.  
  76.     ENTER ("csin");
  77.     DEBUG4 ("csinin", "arg %le %le", z.real, z.imag);
  78.     result.real = sin (z.real) * cosh (z.imag);
  79.     result.imag = cos (z.real) * sinh (z.imag);
  80.     DEBUG4 ("csinout", "result %le %le", result.real, result.imag);
  81.     LEAVE ();
  82.     return (result);
  83. }
  84.